<template>
<div id="wrap">
  <van-badge-group style="float: left;width:16%" :active-key="activeKey">
    <van-badge title="热销榜" @click="onClick"></van-badge>
    <van-badge title="寿司" @click="onClick" ></van-badge>
    <van-badge title="寿司" @click="onClick" ></van-badge>
    <van-badge title="寿司" @click="onClick" info="1"></van-badge>
  </van-badge-group>
  <div style="float: left;padding: 5px 10px;width: 76%;">
    <div v-if="activeKey==0">
      <ul>
        <li style="height: 150px;width: 32%;float: left;margin-left:1%">
          <router-link class='product-wrap' :to="{ path: '/market/productDetail', query: { id: 111 }}">
          <img style="height: 150px;width: 100%;" src="../../assets/market/1.jpg" />
          <div style="text-align: center;padding: 3px;">东西</div>
          </router-link>
        </li>
        <li style="height: 150px;width: 32%;float: left;margin-left:1%">
          <router-link class='product-wrap' :to="{ path: '/market/productDetail', query: { id: 111 }}">
          <img style="height: 150px;width: 100%;" src="../../assets/market/1.jpg" />
          <div style="text-align: center;padding: 3px;">东西</div>
          </router-link>
        </li>
        <li style="height: 150px;width: 32%;float: left;margin-left:1%">
          <router-link class='product-wrap' :to="{ path: '/market/productDetail', query: { id: 111 }}">
          <img style="height: 150px;width: 100%;" src="../../assets/market/1.jpg" />
          <div style="text-align: center;padding: 3px;">东西</div>
          </router-link>
        </li>
      </ul>
    </div>
    <div v-if="activeKey==1">1</div>
    <div v-if="activeKey==2">2</div>
  </div>
</div>
</template>

<script>

import { Badge, BadgeGroup } from 'vant'
import 'vant/lib/vant-css/index.css'
import Vue from 'vue'
Vue.component(Badge.name, Badge)
Vue.component(BadgeGroup.name, BadgeGroup)
import * as utils from '../utils/utils'
import { getAuthInfo } from '../utils/common'

export default {
  components: {
  },
  data () {
    return {
      activeKey: 0
    }
  },
  mounted: function () {
    console.log('圆面积：' + utils.area(4))
    console.log('圆周长：' + utils.circumference(14))
    this.top = 1
    this.bottom = 5
  },
  created: function () {
    getAuthInfo('home')
  },
  methods: {
    onClick (key) {
      this.activeKey = key
    }
  }
}
</script>

<style scoped>

.product-wrap{
  padding:5px;
  color: #666;
}

.product-img-wrap{
  width:30%;
  float: left;
  height: 118px;
}

.product-img{
  height: 118px;
  width:100%;
}

.product-intro-wrap{
  width:70%;
  float: left;
  height: 128px;
  text-align:left;
}

.product-intro{
  font-size:14px;
  font-family:Georgia, serif;
  color:#8a8a8a
}

.weui-grid {
  padding: 0 5px 0 5px !important;
}

.copyright {
  font-size: 12px;
  color: #ccc;
  text-align: center;
}
.text-scroll {
  border: 1px solid #ddd;
  border-left: none;
  border-right: none;
}
.text-scroll p{
  font-size: 12px;
  text-align: center;
  line-height: 30px;
}
.black {
  background-color: #000;
}
.title{
  line-height: 100px;
  text-align: center;
  color: #fff;
}
.animated {
  animation-duration: 1s;
  animation-fill-mode: both;
}
.vux-indicator.custom-bottom {
  bottom: 30px;
}
@-webkit-keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 100%, 0);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 100%, 0);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
.fadeInUp {
  animation-name: fadeInUp;
}
.swiper-demo-img img {
  width: 100%;
}
.market-category{
  text-align: center;
  background-position: center;
  color: #10c5b6;
  background-attachment: fixed;
  background-repeat:no-repeat; 
  background-size:100% 100%;
  -moz-background-size:100% 100%;
}
.m-bar{
  color: #ff6769;
  border-color: #ff6769;
  border-radius: 4px;
  border: 1px solid;
  padding: 5px 20px 5px 20px;
}

#search{
  background: none; 
  outline:none;
  outline:medium;
}

.input-lg {
    height: 21px;
    margin:5px;
    width: 84%;
    padding: 3px;
    font-size: 18px;
    line-height: 1.3333333;
    border-radius: 6px;
    border:1px solid #10c5b6;
}
.search-btn{
  background-color: rgb(16, 197, 182);
  color: rgb(255, 255, 255);
  display: block;
  float: right;
  border-radius: 3px;
  padding: 5px;
  width: 7%;
  margin: 5px 5px 0 0;
  text-align: center;
  font-size: 0.75rem;
  height: 19px;
  line-height: 19px;
}

input::-webkit-input-placeholder, textarea::-webkit-input-placeholder {
　color: #666;font-size:16px;
  line-height: 21px;
}
input:-moz-placeholder, textarea:-moz-placeholder {
　color:#666;font-size:16px;
  line-height: 21px;
}
input::-moz-placeholder, textarea::-moz-placeholder {
　color:#666;font-size:16px;
  line-height: 21px;
}
input:-ms-input-placeholder, textarea:-ms-input-placeholder {
　color:#666;font-size:16px;
  line-height: 21px;
}
</style>
